#!/bin/bash
# Zaitan Module - Eclipse Install
# Zaitan Team <http://code.google.com/p/zaitan/>

RMOD_ENGINE='1.0'
RMOD_CATEGORY='Software'
RMOD_SUBCATEGORY='Developed'
RMOD_NAME='Eclipse'
RMOD_AUTHOR='Zaitan Team'
RMOD_VERSION='3.3.1'
RMOD_DESCRIPTION='Installs Eclipse'
RMOD_UPDATE_URL='http://code.google.com/p/zaitan/'


echo Running $RMOD_NAME...
#/usr/lib/zaitan/modulo/mod-checkInstall
/usr/lib/zaitan/modulo/mod-jdk6


# Instala o Eclipse


cd /usr/share/zaitan
wget -c ftp://ftp.pucpr.br/eclipse/eclipse/downloads/drops/R-3.3.1-200709211145/eclipse-SDK-3.3.1-linux-gtk.tar.gz

tar xzf eclipse-SDK-3.3.1-linux-gtk.tar.gz
mv eclipse /opt/eclipse 
cd /opt 
chown -R root:root eclipse
chmod -R +r eclipse
chmod +x `find eclipse -type d`

touch /usr/bin/eclipse
chmod 755 /usr/bin/eclipse

echo '#!/bin/sh
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse $*' | tee -a /usr/bin/eclipse

echo '[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true' | tee -a /usr/share/applications/eclipse.desktop

#/opt/eclipse/eclipse -clean


echo $RMOD_NAME Finibashed...

##Logs
echo $RMOD_NAME-$RMOD_VERSION | tee -a /usr/share/zaitan/logs
/usr/lib/zaitan/modulo/mod-logs
##

exit 0

